<?php

/*

  Treasure	$7

  Worth ?$
  When you play this, it’s worth $1 per Treasure card you have in play (counting this).

 */

class Bank extends Card implements iTreasure, iKingdom, iProsperity {

    public function __construct() {
        parent::__construct("Bank", 7);
        $this->value = new Price(0);
        $this->undoPlay = true;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "Worth ?$",
            " When you play this, it’s worth $1 per Treasure card you have in play (counting this).");
    }
    
    public function autoPlayNum(Game $game) {
        return 10;
    }
    
    public function getMoneyValue(Game $game) {
        $playArea = $game->getPlayArea();
        $treasures = 0;
        foreach ($playArea as $card) {
            if ($card instanceof iTreasure) {
                $treasures++;
            }
        }
         ScreenDisplay::addScreenMessage($game, true, "get +$treasures$ from ".  nicePrint($this), "gets +$treasures$ from ". ScreenDisplay::$LMSG);
        return new Price($treasures);
    }
}

?>